﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="BJXXFillApplication.aspx.cs" Inherits="WXYW.BJXXFillApplication" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitlePlaceHolder" runat="server">
    填写申请单
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ButtonPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContentPlaceHolder" runat="server">
    <table border="0px" cellpadding="0px" cellspacing="0px" style="width: 100%; line-height: 25px">
        <tr style="height: 25px;">
            <td colspan="6" style="border-bottom-style: solid; border-bottom-width: 1px;">
                <b>用户信息&nbsp;</b>
                <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="UserRegister.aspx" Target="_blank">注册</asp:HyperLink>
            </td>
        </tr>
        <tr style="height: 25px;">
            <td colspan="6">
                <span style="color: Red">如果是新用户请点击"注册"来注册用户信息，注册后请通过姓名或公司名称查询用户信息</span>
            </td>
        </tr>
        <tr>
            <td><asp:Label ID="errorMsgLbl" runat="server" Visible="false" ForeColor="Red" BorderColor="Red"
            BorderWidth="1px" BorderStyle="Solid" Width="97%"></asp:Label></td>
        </tr>
        <tr style="height: 25px;">
            <td style="width: 10%">
                姓名：
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <%--<asp:Label ID="applierNameTxtBox" runat="server" Text="" Width="100%"></asp:Label>--%>
                <asp:TextBox ID="clientTextBox" runat="server" autocomplete="off" Width="95%" AutoPostBack="true"
                    OnTextChanged="clientTextBox_TextChanged"></asp:TextBox><span style="color: Red">*</span>
                <cc1:AutoCompleteExtender ID="AutoCompleteExtender1" TargetControlID="clientTextBox"
                    runat="server" CompletionInterval="1000" MinimumPrefixLength="1" ServicePath="WXYWService.asmx"
                    ServiceMethod="GetConnectPerson" CompletionListCssClass="autocomplete_completionListElement"
                    CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                    EnableCaching="true">
                </cc1:AutoCompleteExtender>
            </td>
            <td style="width: 5%">
            </td>
            <td style="width: 8%">
                公司名称：
            </td>
            <td style="width: 30%; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:TextBox ID="applyCompanyNameTxtBox" runat="server" Width="95%" AutoPostBack="true"
                    OnTextChanged="applyCompanyNameTxtBox_TextChanged"></asp:TextBox><span style="color: Red">*</span>
                <cc1:AutoCompleteExtender ID="AutoCompleteExtender2" TargetControlID="applyCompanyNameTxtBox"
                    runat="server" CompletionInterval="1000" MinimumPrefixLength="1" ServicePath="WXYWService.asmx"
                    ServiceMethod="GetCompany" CompletionListCssClass="autocomplete_completionListElement"
                    CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                    EnableCaching="true">
                </cc1:AutoCompleteExtender>
            </td>
            <td style="width: 17%">
            </td>
        </tr>
        <tr style="height: 25px">
            <td>
                电话：
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="applierPhoneTxtBox" runat="server" Text="" Width="100%"></asp:Label>
            </td>
            <td>
            </td>
            <td>
                手机号码：
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="applierMobilePhoneTxtBox" runat="server" Width="100%"></asp:Label>
            </td>
            <td>
            </td>
        </tr>
        <tr style="height: 25px">
            <td>
                传真：
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="applierFaxTxtBox" runat="server" Text="" Width="100%"></asp:Label>
            </td>
            <td>
            </td>
            <td>
                通讯地址：
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <asp:Label ID="mailAddressTxtBox" Width="100%" runat="server" Text=""></asp:Label>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td style="height: 25px">
                邮箱：
            </td>
            <td style="border-bottom: 1px solid Gray; height: 25px;">
                <asp:Label ID="applierEmailTxtBox" runat="server" Text="" Width="100%"></asp:Label>
            </td>
            <td style="height: 25px">
            </td>
            <td style="height: 25px">
                代理商/销售员：
            </td>
            <td style="border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: Gray;">
                <%--<asp:DropDownList runat="server" ID="sourceDropdownList">
                </asp:DropDownList>--%>
                <asp:TextBox ID="ProviderTxtBox" runat="server" Width="95%"></asp:TextBox>
            </td>
            <td style="height: 25px">
            </td>
        </tr>
        <tr>
            <td style="height: 25px">
                收货信息：
            </td>
            <td style="height: 25px;" colspan="3">
                <asp:TextBox ID="shxxTxtBox" runat="server" Width="95%"></asp:TextBox><span style="color: Red">*</span>
            </td>
            <td colspan="2">
                <span style="color: Red">请在此详细填写客户收货地址、联系人、联系手机号码</span>
            </td>
        </tr>
        <tr style="height: 25px;">
            <td colspan="6" style="border-bottom-style: solid; border-bottom-width: 1px;">
                <b>产品信息</b>
            </td>
        </tr>
    </table>
    <div style="overflow: auto; width: 100%; font-size: 9pt;" class="tableList">
        <asp:ListView ID="productListView" runat="server" ItemPlaceholderID="itemPlaceHolder"
            OnItemCanceling="productListView_ItemCanceling" OnItemEditing="productListView_ItemEditing"
            OnItemInserting="productListView_ItemInserting" OnItemUpdating="productListView_ItemUpdating"
            DataKeyNames="ApplicationProductID" InsertItemPosition="LastItem" OnItemDataBound="productListView_ItemDataBound">
            <LayoutTemplate>
                <table style="width: 100%;" cellpadding="0px" cellspacing="0px">
                    <thead style="font-size: 8pt">
                        <th style="width: 11%">
                            产品类型
                        </th>
                        <th style="width: 3%">
                            数量
                        </th>
                        <th style="width: 10%">
                            序列号
                        </th>
                        <th style="width: 6%">
                            版本号
                        </th>
                        <th style="width: 7%">
                            故障类型
                        </th>
                        <th style="width: 6%">
                            申请类型
                        </th>
                        <th style="width: 11%">
                            故障描述
                        </th>
                        <th style="width: 9%">
                            外观及附件
                        </th>
                        <th style="width: 7%">
                            购买日期
                        </th>
                        <th style="width: 7%">
                            保修性质
                        </th>
                        <th style="width: 10%">
                            需求说明
                        </th>
                        <th style="width: 8%">
                            购买延保
                        </th>
                        <th style="width: 7%">
                            操作
                        </th>
                    </thead>
                    <tbody>
                        <asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
                    </tbody>
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr style="height: 25px;">
                    <td style="width: 11%; text-align: left">
                        <asp:Label ID="Label1" runat="server" Text='<%#Eval("ProductType.ProductTypeName") %>'
                            Width="90%"></asp:Label>
                    </td>
                    <td style="width: 3%; text-align: center">
                        <asp:Label ID="Label9" runat="server" Text='<%# Bind("ProductCount") %>' Width="90%"></asp:Label>
                    </td>
                    <td style="width: 10%; text-align: left">
                        <asp:Label ID="Label10" runat="server" Text='<%# Bind("ProductSerialNumber") %>'
                            Width="90%"></asp:Label>
                    </td>
                    <td style="width: 6%; text-align: left">
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("ProductVersionNumber") %>'
                            Width="90%"></asp:Label>
                    </td>
                    <td style="width: 8%; text-align: left">
                        <asp:Label ID="Label11" runat="server" Text='<%# Bind("ProblemType.Name") %>' Width="90%"></asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="Label5" runat="server" Text='' Width="90%"></asp:Label>
                    </td>
                    <td style="width: 13%; text-align: left">
                        <asp:TextBox ID="Label12" runat="server" Text='<%# Bind("ProductProblemDescription") %>'
                            Width="90%" TextMode="MultiLine" ReadOnly="true" Columns="10" Rows="2" CssClass="NoneBorderTxtBox"></asp:TextBox>
                    </td>
                    <td style="width: 10%; text-align: left">
                        <asp:Label ID="Label13" runat="server" Text='<%# Bind("ProductAppearance") %>' Width="90%"></asp:Label>
                    </td>
                    <td style="width: 7%; text-align: left">
                        <asp:Label ID="Label14" runat="server" Text='<%# Convert.ToDateTime(Eval("ProductPurchaseDateTime")).ToString("yyyy-MM-dd") %>'
                            Width="90%"></asp:Label>
                    </td>
                    <td style="width: 7%; text-align: left">
                        <asp:Label ID="Label2" runat="server" Text='<%#Eval("ProductRepairType") %>' Width="90%"></asp:Label>
                    </td>
                    <td style="width: 12%; text-align: left">
                        <asp:Label ID="Label4" runat="server" Text='<%#Eval("BJSQNeedComment") %>' Width="90%"></asp:Label>
                    </td>
                    <td style="width: 8%; text-align: left">
                        <%--<%# Convert.ToBoolean(Eval("BJSQYBService"))%>--%>
                        <asp:HiddenField ID="ProductID" Value='<%#Eval("ApplicationProductID") %>' runat="server" />
                        <asp:RadioButtonList ID="YBRadioButtonList" runat="server" Width="90%" RepeatDirection="Horizontal"
                            BorderStyle="None" Enabled="false">
                            <asp:ListItem Text="是"></asp:ListItem>
                            <asp:ListItem Text="否"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td style="width: 7%; text-align: center">
                        <table border="0px" cellpadding="0px" cellspacing="0px" width="100%">
                            <tr>
                                <td>
                                    <asp:Button ID="btnEdit" runat="server" Text="修改" CommandName="Edit" CommandArgument='<%#Eval("ApplicationProductID") %>'
                                        Width="90%" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnDelete" runat="server" Text="删除" OnClientClick="confirm('你确定要删除这个产品吗？');"
                                        OnClick="btnDelete_Click" CommandArgument='<%#Eval("ApplicationProductID") %>'
                                        Width="90%" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </ItemTemplate>
            <EditItemTemplate>
                <tr>
                    <td style="width: 11%; text-align: left">
                        <asp:HiddenField ID="ProductID" runat="server" Value='<%#Eval("ApplicationProductID")%>' />
                        <asp:DropDownList ID="ProductClassDDL" runat="server" Width="99%" AutoPostBack="true"
                            OnSelectedIndexChanged="ProductClassDDLEdit_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:UpdatePanel ID="UpdatePanel" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ProductTypeDDL" runat="server" Width="99%">
                                </asp:DropDownList>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="ProductClassDDL" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                    <td style="width: 3%; text-align: center">
                        <asp:TextBox ID="TextBox1" runat="server" Enabled="false" Text='<%#Eval("ProductCount")%>'
                            Width="90%"></asp:TextBox>
                    </td>
                    <td style="width: 10%; text-align: left">
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ProductSerialNumber") %>'
                            Width="90%"></asp:TextBox>
                    </td>
                    <td style="width: 6%; text-align: left">
                        <asp:DropDownList ID="VersionNumberDDL" runat="server" Width="90%">
                        </asp:DropDownList>
                    </td>
                    <td style="width: 8%; text-align: left">
                        <asp:DropDownList ID="DropDownList2" runat="server" Width="90%">
                        </asp:DropDownList>
                    </td>
                    <td style="width: 8%; text-align: left">
                        <asp:DropDownList ID="formTypeDropDownList" runat="server">
                            <asp:ListItem Text="备件先行" Value="B"></asp:ListItem>
                            <asp:ListItem Text="DOA" Value="D"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td style="width: 13%; text-align: left">
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("ProductProblemDescription") %>'
                            Width="90%"></asp:TextBox>
                    </td>
                    <td style="width: 10%; text-align: left">
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("ProductAppearance") %>'
                            Width="90%"></asp:TextBox>
                    </td>
                    <td style="width: 7%; text-align: left">
                        <asp:TextBox ID="TextBox5" runat="server" AutoComplete="off" Text='<%# Convert.ToDateTime(Eval("ProductPurchaseDateTime")).ToString("yyyy-MM-dd") %>'
                            Width="90%"></asp:TextBox>
                        <%--<img src="image/Calendar_scheduleHS.png" id="dateImage" alt="" />--%>
                        <cc1:CalendarExtender ID="CalendarExtender1" runat="server" Format="yyyy-MM-dd" TargetControlID="TextBox5">
                        </cc1:CalendarExtender>
                    </td>
                    <td style="width: 7%; text-align: left">
                        <asp:DropDownList ID="DropDownList3" runat="server" Width="90%">
                            <asp:ListItem Text="保内"></asp:ListItem>
                            <asp:ListItem Text="保外"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td style="width: 12%; text-align: left">
                        <asp:TextBox ID="NeedCommentTxtBox" runat="server" Width="90%" Text='<%#Bind("BJSQNeedComment")%>'></asp:TextBox>
                    </td>
                    <td style="width: 8%; text-align: left">
                        <asp:RadioButtonList ID="YBRadioButtonList" runat="server" Width="90%" RepeatDirection="Horizontal"
                            BorderStyle="None">
                            <asp:ListItem Text="是"></asp:ListItem>
                            <asp:ListItem Text="否"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td style="width: 7%; text-align: center">
                        <table border="0px" cellpadding="0px" cellspacing="0px" width="100%">
                            <tr>
                                <td>
                                    <asp:Button ID="btnUpdate" runat="server" Text="更新" CommandName="Update" Width="90%" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnCancel" runat="server" Text="取消" CommandName="Cancel" Width="90%" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </EditItemTemplate>
            <InsertItemTemplate>
                <tr style="height: 20px">
                    <td style="width: 11%; text-align: left">
                        <asp:DropDownList ID="ProductClassDDL" runat="server" Width="99%" AutoPostBack="true"
                            OnSelectedIndexChanged="ProductClassDDLInsert_SelectedIndexChanged">
                        </asp:DropDownList>
                        <asp:UpdatePanel ID="UpdatePanel" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="DropDownList1" runat="server" Width="99%">
                                </asp:DropDownList>
                            </ContentTemplate>
                            <Triggers>
                                <asp:AsyncPostBackTrigger ControlID="ProductClassDDL" />
                            </Triggers>
                        </asp:UpdatePanel>
                    </td>
                    <td style="width: 3%; text-align: center">
                        <asp:TextBox ID="TextBox1" runat="server" Text="1" Enabled="false" Width="70%"></asp:TextBox>
                    </td>
                    <td style="width: 10%; text-align: left">
                        <asp:TextBox ID="TextBox2" runat="server" Width="90%"></asp:TextBox>
                    </td>
                    <td style="width: 6%; text-align: left">
                        <asp:DropDownList ID="VersionNumberDDL" runat="server" Width="90%">
                        </asp:DropDownList>
                    </td>
                    <td style="width: 7%; text-align: left">
                        <asp:DropDownList ID="DropDownList2" runat="server" Width="90%">
                        </asp:DropDownList>
                    </td>
                    <td style="width: 5%; text-align: left">
                        <asp:DropDownList ID="DropDownList4" runat="server" Width="90%">
                            <asp:ListItem Text="备件先行" Value="B"></asp:ListItem>
                            <asp:ListItem Text="DOA" Value="D"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td style="width: 10%; text-align: left">
                        <asp:TextBox ID="TextBox3" runat="server" Width="90%"></asp:TextBox>
                    </td>
                    <td style="width: 9%; text-align: left">
                        <asp:TextBox ID="TextBox4" runat="server" Width="90%"></asp:TextBox>
                    </td>
                    <td style="width: 7%; text-align: left">
                        <asp:TextBox ID="TextBox5" runat="server" AutoComplete="off" Width="90%"></asp:TextBox>
                        <%--<img src="image/Calendar_scheduleHS.png" id="dateImage" alt="" />--%>
                        <cc1:CalendarExtender ID="CalendarExtender2" Format="yyyy-MM-dd" TargetControlID="TextBox5"
                            runat="server">
                        </cc1:CalendarExtender>
                    </td>
                    <td style="width: 6%; text-align: left">
                        <asp:DropDownList ID="DropDownList3" runat="server" Width="90%">
                            <asp:ListItem Text="保内"></asp:ListItem>
                            <asp:ListItem Text="保外"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="NeedCommentTxtBox" runat="server" Width="90%"></asp:TextBox>
                    </td>
                    <td style="width: 10%; text-align: left">
                        <asp:RadioButtonList ID="YBRadioButtonList" runat="server" Width="90%" RepeatDirection="Horizontal"
                            BorderStyle="None">
                            <asp:ListItem Text="是"></asp:ListItem>
                            <asp:ListItem Text="否" Selected="True"></asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                    <td style="width: 7%; text-align: center">
                        <asp:Button ID="deleteInsertItemBtn" runat="server" Text="删除" Width="80%" OnClick="deleteInsertItemBtn_Click" />
                    </td>
                    <%--<td style="width: 13%; text-align: left">
                        <asp:Button ID="btnUpdate" runat="server" Text="添加" ValidationGroup="NewApplicationValidation"
                            CommandName="Insert" Width="45%" />
                        <asp:Button ID="btnCancel" runat="server" Text="删除" CommandName="Cancel" Width="80%" />
                    </td>--%>
                </tr>
            </InsertItemTemplate>
        </asp:ListView>
    </div>
    <div style="width: 100%; text-align: center; padding-top: 10px;">
        <asp:Button ID="btnUpdate" runat="server" Text="添加" CommandName="Insert" Width="80px"
            OnClick="btnUpdate_Click" />
        <asp:Button ID="PreviewButton" runat="server" Text="预览申请单" OnClick="PreviewButton_Click" />
    </div>
    <table width="100%">
        <tr style="height: 20px;">
            <td colspan="6" style="border-bottom-style: solid; border-bottom-width: 1px; width: 100%">
                <hr />
            </td>
        </tr>
        <tr style="height: 25px;">
            <td colspan="6" style="border-bottom-style: solid; border-bottom-width: 1px;">
                <b>图片预览</b>
            </td>
        </tr>
        <tr style="height: 5px;">
            <td colspan="6">
            </td>
        </tr>
        <tr style="height: 5px;">
            <td colspan="6">
                <asp:Panel ID="picturePanel" runat="server">
                </asp:Panel>
            </td>
        </tr>
        <tr style="height: 25px;">
            <td colspan="6" style="border-bottom-style: solid; border-bottom-width: 1px;">
                <b>上传图片</b>
            </td>
        </tr>
        <tr style="height: 5px;">
            <td colspan="6">
            </td>
        </tr>
        <tr style="height: 25px;">
            <td colspan="3">
                <asp:FileUpload ID="FileUpload1" runat="server" Width="400px" />
            </td>
            <td colspan="3">
                <asp:Button ID="uploadButton" runat="server" Text="上传" Width="80px" OnClick="uploadButton_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="6">
                <p style="color: Red; margin-top: 10px; margin-bottom: 10px;">
                    填写注意事项:请将判断为符合条件的发票或合同凭证请上传到系统上，以便核实。</p>
            </td>
        </tr>
    </table>
</asp:Content>
